package site.member.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import site.member.domain.MemberCommand;

public class MemberLoginValidator implements Validator{

	@Override
	public boolean supports(Class<?> clz) {
		return MemberCommand.class.isAssignableFrom(clz);
	}

	@Override
	public void validate(Object o, Errors e) {
		ValidationUtils.rejectIfEmptyOrWhitespace(e, "id", "login.required");
		ValidationUtils.rejectIfEmptyOrWhitespace(e, "pass", "login.required");
		
	}
}